//
//  BLEHelper.h
//  SiterLib
//
//  Created by tracyhenry on 2022/12/20.
//

#import <Foundation/Foundation.h>
#import "Peripheral.h"
#import "DeviceModel.h"

NS_ASSUME_NONNULL_BEGIN

@protocol BLEDelegate;

@interface BLEHelper : NSObject

-(instancetype)initWithDelegate:(id<BLEDelegate>) delegate;

//开始扫描
- (void)startScan:(NSString *)ssid withPwd:(NSString *)pwd;

//发现多个设备时选择其中一个进行连接
-(void)setConnectDevice:(Peripheral *)device;

//断开连接，释放资源
-(void)disconnect;

@end


@protocol BLEDelegate <NSObject>
-(void)findMULBLEDevice:(NSMutableArray *)deviceList;

-(void)shakeHandsEnd:(NSString *)thingName;

-(void)blueToothAvailable;

-(void)dueWithErr:(NSError *)error;

-(void)bindDeviceModel:(NSString *)thingName;
@end
NS_ASSUME_NONNULL_END
